package com.team233.zuccecho.repository;

import com.team233.zuccecho.Bean.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface StudentRepository extends JpaRepository<Student,Integer> {
    @Query(value="select * from student where student_id=?1",nativeQuery = true)
    Student findStuById(long stu_id);

    @Transactional
    @Modifying
    @Query(value="update student set student_password=?1 where student_id=?2",nativeQuery = true)
    int ModifyPwd(String newpwd,long stu_id);
}
